Removes areas of shading from 1 bit images. Text within the shaded area will generally be preserved.
→
The uncompressed image to be processed must reside in the Get Queue prior to REQ_EXEC. Typically, the image will be fully contained in the Get Queue, but that is not a requirement. The output image will be placed into the Put Queue during REQ_EXEC.
Padding pixels present at the end of each line may be modified by this operation.
This operation relies primarily on three parameters to select the areas to remove: minimum area width, minimum area height, and maximum dot size. All three criteria must be true of an area for it to be removed.
- Subcode is set to SF_SUBCODE_REMOVE_DOT_SHADING (17).
- u.SC17.DensityAdjustment is set to a value that indicates the expected density of shaded areas. Negative numbers instruct the opcode to search for shaded areas with more white pixels than black pixels and positive numbers instruct the opcode to search for shaded areas with more black pixels than white ones. Valid values are -50 to +50, with 0 being a good default and values from -5 to +5 covering nearly all typical cases.
- u.SC17.HorizontalSizeAdjustment modifies the horizontal component of the dot shading removal feature. Set to 1 if some wide dots survive the Dot-Shading Removal process; this causes the dot removal feature to remove dots 1 pixel wider than the size specified in u.SC17.MaximumDotSize. Set to -1 or -2, if text is being degraded (leaving horizontal white streaks). Valid values are from -100 to +100, with 0 being a good default.
- u.SC17.MaximumDotSize is set to the maximum size of individual dots that make up the dot shading. Dots up to, and including, this size are removed. Valid values are from 0 to 20, with 5 being a good default.
- u.SC17.MaximumVerificationHeight is set to the maximum height of shaded areas that will be double-checked for proper detection. Double-checking zones will cause detection to run slower. Valid values are from 0 to 20,000, with 20,000 being a good default.
- u.SC17.MinimumAreaHeight is set to the height of the smallest dot-shaded area that the opcode processes. Valid values are from 0 to 20,000, with 50 being a good default value.
- u.SC17.MinimumAreaWidth is set to the width of the smallest dot-shaded area that the opcode processes. Valid values are from 0 to 20,000, with 100 being a good default value.
- u.SC17.VerticalSizeAdjustment modifies the vertical component of the dot shading removal feature. Set to 1 if some tall dots survive the Dot-Shading Removal process; this causes the dot removal feature to remove dots 1 pixel taller than the size specified in SC17.MaximumDotSize. Set to -1 or -2, if text is being degraded (leaving vertical white streaks). Valid values are from -100 to +100, with 0 being a good default.
- Stride is set to the image line width in bytes including padding at the end of the line width or to 0. If Stride is 0 and PF_NoDibPad is set in PicFlags, the operation will compute the stride using: [ (PixelWidth*BitCount)/8 ]. If Stride is 0 and PF_NoDibPad is not set in PicFlags, the operation will compute the stride using: [ (((PixelWidth*BitCount)+31)&(~31))/8 ].
In addition to placing an output image into the Put Queue, this operation stores some output information into the PIC_PARM structure in the following locations.
- CountOfFeaturesDetected is set, during REQ_EXEC, to the number of areas removed.
- OutputStride is set, during REQ_INIT and REQ_EXEC, to the image line width in bytes including padding at the end of the line.
- BiOut is set, during REQ_INIT and REQ_EXEC, to the attributes of the output image. Since this operation does not adjust the size of the image, BiOut will be set to a copy of the Head structure within PIC_PARM.